#define DEBUG
#include <cstdio>
#define MAXN 100000

using namespace std;

int main() {
#ifdef DEBUG
  freopen("2.in", "r", stdin);
  freopen("2.out", "w", stdout);
#endif

  static char s[MAXN+2];
  static bool book[MAXN+1];
  int n, m;
  scanf("%d %d", &n, &m);
  scanf("%s", s+1);
  
  int cnt=0;
  for (int i=1; i<=n; i++) {
    for (int j=1; j<i && !book[i]; j++) {
      book[i] = true;
      for (int k=1; k<n && book[i]; k++) {
	int x=k<i ? k : k+1, y=k<j ? k : k+1;
	book[i] = book[i] && s[x]==s[y];
      }
    }
    if (!book[i]) {
      cnt++;
    }
  }

  printf("%lld\n", (long long)cnt*((n-1)*m+m-1));

  fclose(stdin);
  fclose(stdout);
  return 0;
}
